class Review < ActiveRecord::Base
  def self.columns() @columns ||= []; end

  def self.column(name, sql_type = nil, default = nil, null = true)
    columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
  end

  column :language, :string, 'de'
  column :rating, :integer
  column :content, :text
  column :tag, :string, 'Restaurant'
  
  #validates_format_of :from_email, :to_email, :with => /^[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$/i

  validates_presence_of :language, :rating, :content, :tag
  validates_length_of :content, :minimum => 20
    
  #has_one :address

  #accepts_nested_attributes_for :address
  
end                                                                                       